package 曾世昌12_8.zuoye17;

import java.lang.reflect.Constructor;
import java.lang.reflect.Method;

public class test {
    public static void main(String[] args) throws Exception {
        Class<?> aClass = Class.forName( "rc.mxdx3_zhoumozuoye.zuoye17.Person" );
        Method setName = aClass.getDeclaredMethod( "setName", String.class );
        setName.setAccessible( true );
        Constructor<?> constructor = aClass.getConstructor();
        Object o = constructor.newInstance();
        setName.invoke( o, "zsc" );
        Method getName = aClass.getDeclaredMethod( "getName" );
        getName.setAccessible( true );
        System.out.println(getName.invoke( o ));
    }
}
